package net.wanho.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.io.File;

@Configuration
public class ResourceConfig implements WebMvcConfigurer {
    @Value("${file.stail}")
    private String stail;
    @Value("${file.path}")
    private String filePath;
    @Override
    public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) {
        registry.addResourceHandler(stail+"/**")
                .addResourceLocations( "file:"+filePath+ File.separator);
    }
}
